import { axios } from '@/service/service'
import { ListReq } from './types'

export function getOrganizationList(
  params: ListReq,
  page: number,
  pageSize: number
): any {
  return axios({
    url: '/system/sysOrgancentre/list',
    method: 'post',
    data: { ...params, page, pageSize },
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    transformRequest: (params) => JSON.stringify(params)
  })
}

export function getOrganizationTree(): any {
  return axios({
    url: '/system/sysOrgancentre/orgTreeData',
    method: 'post',
    data: { organId: '' },
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    transformRequest: (params) => JSON.stringify(params)
  })
}
